package com.medical.app.repository;

import com.medical.app.entity.Medication;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MedicationRepository extends JpaRepository<Medication, Long> {
    List<Medication> findByUserIdOrderByStartDateDesc(Long userId);
    long countByUserId(Long userId); // 添加这个方法
}